/****************************************************************/
/*  I M P E T U S     C O P Y R I G H T      S T A T E M E N T  */
/****************************************************************/
/*                                                              */
/*  NOTICE: THIS SOFTWARE CONTAINS TRADE SECRETS THAT BELONG TO */
/*          IMPETUS INFOTECH, AND IS LICENSED BY AN AGREEMENT.  */
/*          ANY UNAUTHORIZED ACCESS, USE, DUPLICATION OR        */
/*          DISCLOSURE IS UNLAWFUL.                             */
/*                                                              */
/*          COPYRIGHT (C) 2008 IMPETUS INFOTECH INDIA PVT LTD   */
/*          ALL RIGHTS RESERVED.                                */
/****************************************************************/
package com.iLabs.spice.beans;

import java.util.List;

import com.iLabs.pagecode.PageCodeBase;
import com.iLabs.spice.dto.UserProfile;
import com.iLabs.spice.handler.AddFriendHandler;

public class PendingRequestBean extends PageCodeBase{
 private List <UserProfile> pendingList;
 private AddFriendHandler addFriendHandler; 
 private boolean hasPendingRequest = true;
 private boolean hasfriendUpdate = false;
 private boolean hasOwnUpdate = false;
 
 public PendingRequestBean() {
	 addFriendHandler= new AddFriendHandler();
	 setPendingList(addFriendHandler.checkFriendRequest());
 }
	


	public List<UserProfile> getPendingList() {
		return pendingList;
	}


	public void setPendingList(List<UserProfile> pendingList) {
		this.pendingList = pendingList;
	}

	public boolean getHasPendingRequest() {
		if(pendingList == null || pendingList.size() ==0){
			hasPendingRequest = false;
		}
		return hasPendingRequest;
	}

	public void setHasPendingRequest(boolean hasPendingRequest) {
		this.hasPendingRequest = hasPendingRequest;
	}
	
	public boolean gethasfriendUpdate() {		
		ProfileBean ownerProfile = (ProfileBean) getSessionScope().get(
				"ownerProfile");
		if ((ownerProfile.getUserFriends().getAllFriendActvityList()) != null &&
				ownerProfile.getUserFriends().getAllFriendActvityList().size() > 0) 
			hasfriendUpdate = true;	
		return hasfriendUpdate;
	}
	
	public void sethasfriendUpdate(boolean hasfriendUpdate) {
		this.hasfriendUpdate = hasfriendUpdate;
	}
	
	public boolean gethasOwnUpdate() {		
		ProfileBean ownerProfile = (ProfileBean) getSessionScope().get(
				"ownerProfile");
		if ((ownerProfile.getUserAuth().getActivities()) != null &&
				ownerProfile.getUserAuth().getActivities().size() > 0) 
			hasOwnUpdate = true;	
		return hasOwnUpdate;
	}
	
	public void sethasOwnUpdate(boolean hasOwnUpdate) {
		this.hasOwnUpdate = hasOwnUpdate;
	}
	
}
